package cn.edu.scau.cmi.mazhuanglong.singleton;

import java.util.ArrayList;

import cn.edu.scau.cmi.mazhuanglong.singleton.Marshal;

public class Marshal {
	
	
	private static ArrayList<Marshal> list = new ArrayList<Marshal>(10);
	private String name;
	
	private Marshal(String name) {
		this.name = name;
	}
	
	public static Marshal getInstance(String name) {
		if(list.size() < 10) {
			Marshal marshal = new Marshal(name);
			list.add(marshal);
			return marshal;
		}
		else return null;
	}
	
	public String getName() {
		return name;
	}
	
	public void setName(String name) {
		this.name = name;
	}
}
